package cn.dac.controller;

import cn.dac.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import springfox.documentation.annotations.ApiIgnore;

import java.util.Date;
@ApiIgnore
@Controller
@RequestMapping("fastjson")
public class FastjsonController {
    @RequestMapping("/test")
    @ResponseBody
    public User test() {
        User user = new User();

        user.setId(1);
        user.setUsername("Tom");
        user.setPassword("123456");
        user.setBirthday(new Date());

        //模拟异常
        /*String str = null;
        if(str.equals("abc")){

        }*/
        //int i = 10/0;
        return user;
    }
}
